#include <stdio.h>
#include <string.h>

int main(int argc, char *argv[])
{
	unsigned int i, j, n, c, l, p[2048], case_num = 1;
	scanf("%d", &n);

	while (n--) {
		scanf("%d", &c);
		scanf("%d", &l);

		for (i=0; i<l; i++) {
			scanf("%d", &p[i]);
		}

		for (i=0; i<l-1; i++) {
			for (j=i+1; j<l; j++) {
				if (p[i] + p[j] == c) {
					printf("Case #%d: %d %d\n", case_num, i+1, j+1);
					goto CASE_COMPLETE;
				}
			}
		}
CASE_COMPLETE:
		case_num++;
	}

	return 0;
}
